// import React, { Component } from 'react'
// import ReactDom from 'react-dom'
import {
  Router,
  // Link,
  Route,
  Switch,
  Redirect,
} from 'react-router-dom'
import AuthRoute from './components/AuthRoute'
import Login from './pages/Login'
import Layout from './pages/Layout'
import history from 'utils/history'

// class App extends Component {
//   render() {
function App() {
  return (
    <Router history={history}>
      <div>
        {/* <ul>
          <li>
            <Link to="/layout">首页</Link>
          </li>
          <li>
            <Link to="/login">登录</Link>
          </li>
        </ul> */}
        <Switch>
          <Redirect exact from="/" to="/login"></Redirect>
          {/* <Route path="/home" component={Layout}></Route> */}
          <AuthRoute path="/home" component={Layout}></AuthRoute>
          <Route path="/login" component={Login}></Route>
        </Switch>
      </div>
    </Router>
  )
}
export default App

// ReactDom.render(
//   <Router>
//     <App></App>
//   </Router>,
//   document.getElementById('root')
// )
